<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/28
 * Time: 16:28
 */

namespace app\api\validate;

/**
 * 前端验证器验证器
 */
class Ticket extends ApiBase
{

    // 验证规则
    protected $rule =   [
        'full_name'          => 'require',
        'sex'       => 'in:1,2',
        'mobile'   => 'require',
        'email'   => 'require',
        'bank_name'=>'require',
        'bank_card'=>'require',
        'bank_phone'=>'require',
        'bank_province'=>'require',
        'bank_city'=>'require',
         'true_name'=>'require',
        'idcard'=>'require',

    ];

    // 验证提示
    protected $message  =   [
        'full_name'         => '姓名不能为空',
        'sex'      => '性别错误',
        'true_name.require'  => '姓名不能为空',
        'idcard.require'  => '身份证号不能为空',
    ];

    // 应用场景
    protected $scene = [
        'buy_ticket'  =>  ['full_name', 'sex', 'mobile'],
        'advertisement'  =>  ['true_name', 'idcard'],
    ];
}